.class public Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;
.super Lcom/vividsolutions/jts/geomgraph/EdgeEnd;
.source "EdgeEndBundle.java"


# instance fields
.field private edgeEnds:Ljava/util/List;


# direct methods
.method public constructor <init>(Lcom/vividsolutions/jts/algorithm/BoundaryNodeRule;Lcom/vividsolutions/jts/geomgraph/EdgeEnd;)V
    .locals 4

    .line 59
    invoke-virtual {p2}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getEdge()Lcom/vividsolutions/jts/geomgraph/Edge;

    move-result-object p1

    invoke-virtual {p2}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getCoordinate()Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v0

    invoke-virtual {p2}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getDirectedCoordinate()Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v1

    new-instance v2, Lcom/vividsolutions/jts/geomgraph/Label;

    invoke-virtual {p2}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getLabel()Lcom/vividsolutions/jts/geomgraph/Label;

    move-result-object v3

    invoke-direct {v2, v3}, Lcom/vividsolutions/jts/geomgraph/Label;-><init>(Lcom/vividsolutions/jts/geomgraph/Label;)V

    invoke-direct {p0, p1, v0, v1, v2}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;-><init>(Lcom/vividsolutions/jts/geomgraph/Edge;Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geomgraph/Label;)V

    .line 55
    new-instance p1, Ljava/util/ArrayList;

    invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V

    iput-object p1, p0, Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;->edgeEnds:Ljava/util/List;

    .line 60
    invoke-virtual {p0, p2}, Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;->insert(Lcom/vividsolutions/jts/geomgraph/EdgeEnd;)V

    return-void
.end method

.method public constructor <init>(Lcom/vividsolutions/jts/geomgraph/EdgeEnd;)V
    .locals 1

    const/4 v0, 0x0

    .line 71
    invoke-direct {p0, v0, p1}, Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;-><init>(Lcom/vividsolutions/jts/algorithm/BoundaryNodeRule;Lcom/vividsolutions/jts/geomgraph/EdgeEnd;)V

    return-void
.end method

.method private computeLabelOn(ILcom/vividsolutions/jts/algorithm/BoundaryNodeRule;)V
    .locals 6

    .line 137
    invoke-virtual {p0}, Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;->iterator()Ljava/util/Iterator;

    move-result-object v0

    const/4 v1, 0x0

    const/4 v2, 0x0

    const/4 v3, 0x0

    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_2

    .line 138
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;

    .line 139
    invoke-virtual {v4}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getLabel()Lcom/vividsolutions/jts/geomgraph/Label;

    move-result-object v4

    invoke-virtual {v4, p1}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(I)I

    move-result v4

    const/4 v5, 0x1

    if-ne v4, v5, :cond_1

    add-int/lit8 v3, v3, 0x1

    :cond_1
    if-nez v4, :cond_0

    const/4 v2, 0x1

    goto :goto_0

    :cond_2
    const/4 v0, -0x1

    if-eqz v2, :cond_3

    const/4 v0, 0x0

    :cond_3
    if-lez v3, :cond_4

    .line 146
    invoke-static {p2, v3}, Lcom/vividsolutions/jts/geomgraph/GeometryGraph;->determineBoundary(Lcom/vividsolutions/jts/algorithm/BoundaryNodeRule;I)I

    move-result v0

    .line 148
    :cond_4
    iget-object p2, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->label:Lcom/vividsolutions/jts/geomgraph/Label;

    invoke-virtual {p2, p1, v0}, Lcom/vividsolutions/jts/geomgraph/Label;->setLocation(II)V

    return-void
.end method

.method private computeLabelSide(II)V
    .locals 3

    .line 176
    invoke-virtual {p0}, Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_2

    .line 177
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;

    .line 178
    invoke-virtual {v1}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getLabel()Lcom/vividsolutions/jts/geomgraph/Label;

    move-result-object v2

    invoke-virtual {v2}, Lcom/vividsolutions/jts/geomgraph/Label;->isArea()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 179
    invoke-virtual {v1}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getLabel()Lcom/vividsolutions/jts/geomgraph/Label;

    move-result-object v1

    invoke-virtual {v1, p1, p2}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result v1

    if-nez v1, :cond_1

    .line 181
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->label:Lcom/vividsolutions/jts/geomgraph/Label;

    const/4 v1, 0x0

    invoke-virtual {v0, p1, p2, v1}, Lcom/vividsolutions/jts/geomgraph/Label;->setLocation(III)V

    return-void

    :cond_1
    const/4 v2, 0x2

    if-ne v1, v2, :cond_0

    .line 185
    iget-object v1, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->label:Lcom/vividsolutions/jts/geomgraph/Label;

    invoke-virtual {v1, p1, p2, v2}, Lcom/vividsolutions/jts/geomgraph/Label;->setLocation(III)V

    goto :goto_0

    :cond_2
    return-void
.end method

.method private computeLabelSides(I)V
    .locals 1

    const/4 v0, 0x1

    .line 156
    invoke-direct {p0, p1, v0}, Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;->computeLabelSide(II)V

    const/4 v0, 0x2

    .line 157
    invoke-direct {p0, p1, v0}, Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;->computeLabelSide(II)V

    return-void
.end method


# virtual methods
.method public computeLabel(Lcom/vividsolutions/jts/algorithm/BoundaryNodeRule;)V
    .locals 4

    .line 94
    invoke-virtual {p0}, Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;->iterator()Ljava/util/Iterator;

    move-result-object v0

    const/4 v1, 0x0

    const/4 v2, 0x0

    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_1

    .line 95
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;

    .line 96
    invoke-virtual {v3}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getLabel()Lcom/vividsolutions/jts/geomgraph/Label;

    move-result-object v3

    invoke-virtual {v3}, Lcom/vividsolutions/jts/geomgraph/Label;->isArea()Z

    move-result v3

    if-eqz v3, :cond_0

    const/4 v2, 0x1

    goto :goto_0

    :cond_1
    const/4 v0, -0x1

    if-eqz v2, :cond_2

    .line 99
    new-instance v3, Lcom/vividsolutions/jts/geomgraph/Label;

    invoke-direct {v3, v0, v0, v0}, Lcom/vividsolutions/jts/geomgraph/Label;-><init>(III)V

    iput-object v3, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->label:Lcom/vividsolutions/jts/geomgraph/Label;

    goto :goto_1

    .line 101
    :cond_2
    new-instance v3, Lcom/vividsolutions/jts/geomgraph/Label;

    invoke-direct {v3, v0}, Lcom/vividsolutions/jts/geomgraph/Label;-><init>(I)V

    iput-object v3, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->label:Lcom/vividsolutions/jts/geomgraph/Label;

    :goto_1
    const/4 v0, 0x2

    if-ge v1, v0, :cond_4

    .line 105
    invoke-direct {p0, v1, p1}, Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;->computeLabelOn(ILcom/vividsolutions/jts/algorithm/BoundaryNodeRule;)V

    if-eqz v2, :cond_3

    .line 107
    invoke-direct {p0, v1}, Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;->computeLabelSides(I)V

    :cond_3
    add-int/lit8 v1, v1, 0x1

    goto :goto_1

    :cond_4
    return-void
.end method

.method public getLabel()Lcom/vividsolutions/jts/geomgraph/Label;
    .locals 1

    .line 74
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->label:Lcom/vividsolutions/jts/geomgraph/Label;

    return-object v0
.end method

.method public insert(Lcom/vividsolutions/jts/geomgraph/EdgeEnd;)V
    .locals 1

    .line 82
    iget-object v0, p0, Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;->edgeEnds:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method public iterator()Ljava/util/Iterator;
    .locals 1

    .line 75
    iget-object v0, p0, Lcom/vividsolutions/jts/operation/relate/EdgeEndBundle;->edgeEnds:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    return-object v0
.end method

.method updateIM(Lcom/vividsolutions/jts/geom/IntersectionMatrix;)V
    .locals 1

    .line 195
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->label:Lcom/vividsolutions/jts/geomgraph/Label;

    invoke-static {v0, p1}, Lcom/vividsolutions/jts/geomgraph/Edge;->updateIM(Lcom/vividsolutions/jts/geomgraph/Label;Lcom/vividsolutions/jts/geom/IntersectionMatrix;)V

    return-void
.end method
